import React, { useEffect } from 'react'
import * as monaco from 'monaco-editor'

import editPage from './editor-page'

function Editor() {
  useEffect(() => {
    setTimeout(() => {
      monaco.editor.create(document.getElementById('code'), {
        value: editPage,
        readOnly: true,
        language: 'javascript'
      })
    }, 100)
  }, [])

  return pug`
    #code
  `
}

export default Editor
